Refactor integration tests for BI Report Server#2432
Refactor integration tests for BI Report Server#2432johlju merged 6 commits intodsccommunity:mainfrom
Conversation
…r BI Report Server - Removed PassThru tests from Enable-SqlDscRsSecureConnection, Initialize-SqlDscRS, Install-SqlDscPowerBIReportServer, Set-SqlDscRSDatabaseConnection, Set-SqlDscRSUrlReservation, Set-SqlDscRSVirtualDirectory. - Simplified test setup and teardown processes by eliminating unnecessary original configuration restoration. - Updated test URLs to avoid port conflicts. - Consolidated test cases for setting URL reservations to ensure multiple URLs can be added and existing ones removed.
WalkthroughRefactors Reporting Services and Power BI Report Server integration tests: removes BeforeAll/AfterAll state capture/restoration and PassThru verification tests, simplifies URL reservation flows (including port changes), deletes one Power BI post-install stop test, and adds an Unreleased CHANGELOG entry. Changes
Sequence Diagram(s)(omitted — changes are test refactors and do not introduce new multi-component control flow) Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
tests/Integration/Commands/Set-SqlDscRSUrlReservation.Integration.Tests.ps1 (1)
43-63: Assign unused Set-SqlDscRSUrlReservation outputs to$null.These calls return objects that aren't used; the test guidelines require assigning unused outputs to
$nullinsideItblocks.As per coding guidelines, please assign unused outputs to `$null` in `It` blocks.♻️ Example fix (apply similarly to each call)
- $script:configuration | Set-SqlDscRSUrlReservation -Application 'ReportServerWebService' -UrlString $script:testUrl1, $script:testUrl2 -Force -ErrorAction 'Stop' + $null = $script:configuration | Set-SqlDscRSUrlReservation -Application 'ReportServerWebService' -UrlString $script:testUrl1, $script:testUrl2 -Force -ErrorAction 'Stop'Also applies to: 65-84, 95-115, 117-136, 147-167, 169-188, 200-220, 222-241
🤖 Fix all issues with AI agents
In
`@tests/Integration/Commands/Remove-SqlDscRSUrlReservation.Integration.Tests.ps1`:
- Line 62: Remove the stray character 's' that appears immediately before the
closing brace on the offending line (it breaks PowerShell parsing); edit the
test block in Remove-SqlDscRSUrlReservation.Integration.Tests.ps1 to delete that
's' so the closing brace '}' stands alone and the script parses correctly.
🧹 Nitpick comments (1)
CHANGELOG.md (1)
10-12: Italicize module/product names per Markdown style guide.To follow the documentation formatting rules, format module/product names in italic.
♻️ Proposed update
-- SqlServerDsc - - Refactor integration tests for SQL Server Reporting Services and Power BI Report - Server ([issue `#2431`](https://github.com/dsccommunity/SqlServerDsc/issues/2431)). +- _SqlServerDsc_ + - Refactor integration tests for _SQL Server Reporting Services_ and _Power BI + Report Server_ ([issue `#2431`](https://github.com/dsccommunity/SqlServerDsc/issues/2431)).
tests/Integration/Commands/Remove-SqlDscRSUrlReservation.Integration.Tests.ps1
Outdated
Show resolved
Hide resolved
…ration.Tests.ps1 Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
…SQL Server Reporting Services and Power BI Report Server
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In
`@tests/Integration/Commands/Disable-SqlDscRsSecureConnection.Integration.Tests.ps1`:
- Line 72: Remove the stray incomplete token "BeforeA" that was left in the test
file (a truncated remnant of a BeforeAll block) so the PowerShell test script
parses correctly; locate the orphaned "BeforeA" text in
Disable-SqlDscRsSecureConnection.Integration.Tests.ps1 and delete that token (or
restore a proper BeforeAll block if the setup logic was accidentally removed)
ensuring no partial keywords remain.
tests/Integration/Commands/Disable-SqlDscRsSecureConnection.Integration.Tests.ps1
Outdated
Show resolved
Hide resolved
…r BI Report Server
… output from Set-SqlDscRSUrlReservation calls
There was a problem hiding this comment.
Actionable comments posted: 0
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
tests/Integration/Commands/Set-SqlDscRSUrlReservation.Integration.Tests.ps1 (1)
43-63: Test name says “remove existing ones,” but assertions don’t verify removal.
Right now the tests only assert containment, so they can pass even if old URLs remain. Either rename the test or add an assertion that no extra URLs exist forReportServerWebService.✅ Suggested assertion (apply to each context)
$currentUrls | Should -Contain $script:testUrl1 $currentUrls | Should -Contain $script:testUrl2 + $currentUrls | Should -HaveCount 2As per coding guidelines, integration tests must cover all scenarios and code paths.
Also applies to: 95-115, 147-167, 200-220
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2432 +/- ##
=====================================
Coverage 94% 94%
=====================================
Files 226 226
Lines 11182 11182
=====================================
Hits 10545 10545
Misses 637 637
🚀 New features to boost your workflow:
|
Pull Request (PR) description
These tests are not really relevant as integration tests ad they are mostly tested by unit tests.
This Pull Request (PR) fixes the following issues
Task list
file CHANGELOG.md. Entry should say what was changed and how that
affects users (if applicable), and reference the issue being resolved
(if applicable).
This change is